num = int(input('输入一个整数：'))
if num > 0:
    x = bin(num)
else:
    x = bin(num & 0xffffffffffffffff)
cnt = 0
for i in x:
    if (i == '1'):
        cnt += 1
print('%d对应的二进制数的1的个数为%d' % (num, cnt))
